home *** CD-ROM | disk | FTP | other *** search
-
- case 24: /* warp operations */
- printf("\nCIPS> Enter input image name\n");
- get_image_name(name);
- printf("\nCIPS> Enter output image name\n");
- get_image_name(name2);
- get_parameters(&il, &ie, &ll, &le);
- get_warp_options(method, &bilinear,
- &x_control, &y_control,
- &x1, &y1, &x2, &y2,
- &x3, &y3, &x4, &y4);
- if(strncmp(method, "warp", 3) == 0)
- warp(name, name2,
- the_image, out_image,
- il, ie, ll, le,
- x_control, y_control,
- bilinear);
- if(strncmp(method, "object-warp", 3) == 0)
- object_warp(name, name2,
- the_image, out_image,
- il, ie, ll, le,
- x1, y1, x2, y2,
- x3, y3, x4, y4,
- bilinear);
- break;
-
- .
- .
- .
- .
-
- /*************************************************
- *
- * show_menu(..
- *
- * This function displays the CIPS main menu.
- *
- **************************************************/
-
- show_menu()
- {
-
- printf(""
- "\n\n\t\t\tWelcome to CIPS"
- "\n\t\tThe C Image Processing System"
- "\n\t\tDwayne Phillips 1990-1993"
- "\nThese are your choices:"
- "\n1. Display image header 13. Image rotate & flip"
- "\n2. Show image numbers 14. Image scaling"
- "\n3. Print image numbers 15. Create blank image"
- "\n4. Display (EGA & VGA) 16. Image thresholding"
- "\n5. Display or print using halftoning 17. Image segmentation"
- "\n6. Print using dithering 18. Edge & gray segmentation"
- "\n7. Print or display histogram 19. Boolean operations"
- "\n8. Edge Detection 20. Image overlay"
- "\n9. Edge Enhancement 21. Shape operations"
- "\n10. Image filtering 22. Texture operations"
- "\n11. Image add & subtract 23. Geometry operations"
- "\n12 Image cut & paste 24. Warp operations"
- "\n30. Exit system\n"
- "\nEnter choice __\b\b");
-
- } /* ends show_menu */
-
- .
- .
- .
- .
-
- /*******************************************
- *
- * get_warp_options(..
- *
- * This routine interacts with the user
- * to obtain the parameters to call the
- * warping subroutines.
- *
- *******************************************/
-
- get_warp_options(operation, bilinear,
- x_control, y_control,
- x1, y1, x2, y2,
- x3, y3, x4, y4)
- char operation[];
- int *bilinear,
- *x_control, *y_control,
- *x1, *y1, *x2, *y2,
- *x3, *y3, *x4, *y4;
- {
- int not_finished, response;
- not_finished = 1;
- while(not_finished){
-
- printf("\nThe warp options are:");
- printf("\n\t1. Operation is %s", operation);
- printf("\n\t (options are: warp object-warp)");
- printf("\n\t2. bilinear is %d", *bilinear);
- printf("\n\t3. Control points: x=%d y=%d",
- *x_control, *y_control);
- printf("\n\t4. x1=%d y1=%d", *x1, *y1);
- printf("\n\t5. x2=%d y2=%d", *x2, *y2);
- printf("\n\t6. x3=%d y3=%d", *x3, *y3);
- printf("\n\t7. x4=%d y4=%d", *x4, *y4);
- printf("\n\t Control points needed for warp");
- printf("\n\t Other points needed for object-warp");
- printf("\n\nEnter choice (0 = no change) _\b");
- get_integer(&response);
-
- if(response == 0)
- not_finished = 0;
-
- if(response == 1){
- printf("\nEnter operation:");
- printf("\n\twarp object-warp");
- printf("\n");
- gets(operation);
- } /* ends if 1 */
-
- if(response == 2){
- printf("\nEnter bilinear:_\b");
- get_integer(bilinear);
- } /* ends if 2 */
-
- if(response == 3){
- printf("\nEnter the control points");
- printf("\nEnter x:___\b\b\b");
- get_integer(x_control);
- printf("\nEnter y:___\b\b\b");
- get_integer(y_control);
- } /* ends if 3 */
-
- if(response == 4){
- printf("\nEnter x1:___\b\b\b");
- get_integer(x1);
- printf("\nEnter y1:___\b\b\b");
- get_integer(y1);
- } /* ends if 4 */
-
- if(response == 5){
- printf("\nEnter x2:___\b\b\b");
- get_integer(x2);
- printf("\nEnter y2:___\b\b\b");
- get_integer(y2);
- } /* ends if 5 */
-
- if(response == 6){
- printf("\nEnter x3:___\b\b\b");
- get_integer(x3);
- printf("\nEnter y3:___\b\b\b");
- get_integer(y3);
- } /* ends if 6 */
-
- if(response == 7){
- printf("\nEnter x4:___\b\b\b");
- get_integer(x4);
- printf("\nEnter y4:___\b\b\b");
- get_integer(y4);
- } /* ends if 7 */
-
- } /* ends while not_finished */
-
-
- } /* ends get_warp_options */
-